import 'package:dio/dio.dart';

class NetWork{
  static String apiUrl = 'https://api.currydc.com/';
  static String appKey = '7cd8e236d41627a7819aaded3383d6c6';

  Future<dynamic> post(String api,{dynamic data}) async {
    try {
      print('url =======' + '$apiUrl$api');
      print('data =======' + '$data');
      var result = await Dio().post(apiUrl+api,
          data: data,
      );
      return result.data;
    } catch (e) {
      return {'code': 500};
    }
  }

  Future<dynamic> get(String api,{dynamic params}) async {
    try {
      print('url =======1' + '$apiUrl$api');
      var result = await Dio().get('$apiUrl$api');
      return result.data;
    } catch (e) {
      return {'code': 500};
    }
  }
}